package cn.com.taiji.oospub.wechat.service.impl;

import cn.com.taiji.oospub.wechat.entity.OrderMainInfo;
import cn.com.taiji.oospub.wechat.mapper.OrderMainInfoMapper;
import cn.com.taiji.oospub.wechat.service.IOrderMainInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2020-10-28
 */
@Service
public class OrderMainInfoServiceImpl extends ServiceImpl<OrderMainInfoMapper, OrderMainInfo> implements IOrderMainInfoService {
    @Autowired
    private OrderMainInfoMapper orderMainInfoMapper;

    @Override
    public OrderMainInfo findByOrderCode(String code) {
        QueryWrapper<OrderMainInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("Code", code);
        return orderMainInfoMapper.selectOne(queryWrapper);
    }

    @Override
    public String getLastOrderCode(String headString) {
        return orderMainInfoMapper.getLastOrderCode();
    }
}
